package com.tarena.lbs.business.rpc;

import com.alibaba.dubbo.config.annotation.Service;
import com.tarena.lbs.business.api.BusinessApi;
import com.tarena.lbs.business.api.pojo.BusinessDto;
import com.tarena.lbs.business.service.BusinessService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import org.springframework.web.bind.annotation.GetMapping;


@Slf4j
@DubboService(version = "1.0.0")
@org.springframework.stereotype.Service
//@EnableDiscoveryClient//启用服务注册与发现功能
public class BusinessApiImpl implements BusinessApi {
    @Autowired
    private BusinessService businessService;

    @Override
    public BusinessDto getBusinessById(Integer businessId) {
        log.info("获取商家信息，商家id：{}", businessId);
     BusinessDto businessDto =   businessService.getBusinessById(businessId);
     log.info("获取商家信息成功，商家信息：{}", businessDto);
     return businessDto;

    }

}
